package com.eastfair.venuebooking.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import org.springframework.format.annotation.DateTimeFormat;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 跟进计划表
 * </p>
 *
 * @author linan
 * @since 2022-06-08
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("vb_follow_plan")
@ApiModel(value = "FollowPlan", description = "跟进计划表")
@AllArgsConstructor
public class FollowPlan extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 客户id，线索id，联系人id
     */
    @ApiModelProperty(value = "客户id，线索id，联系人id")
    @TableField(value = "subject_id")
    @Excel(name = "客户id，线索id，联系人id")
    private Long subjectId;

    /**
     * 模块名称(枚举维护)
     */
    @ApiModelProperty(value = "模块名称(枚举维护)")
    @Size(max = 20, message = "模块名称(枚举维护)长度不能超过20")
    @TableField(value = "subject_type", condition = LIKE)
    @Excel(name = "模块名称(枚举维护)")
    private String subjectType;

    /**
     * 计划跟进时间
     */
    @ApiModelProperty(value = "计划跟进时间")
    @TableField(value = "plan_follow_date")
    @Excel(name = "计划跟进时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime planFollowDate;

    /**
     * 跟进内容
     */
    @ApiModelProperty(value = "跟进内容")
    @Size(max = 255, message = "跟进内容长度不能超过255")
    @TableField(value = "content", condition = LIKE)
    @Excel(name = "跟进内容")
    private String content;

    /**
     * 跟进用户id
     */
    @ApiModelProperty(value = "跟进用户id")
    @TableField(value = "follow_user_id")
    @Excel(name = "跟进用户id")
    private Long followUserId;

    /**
     * 跟进提醒(数据字典)
     */
    @ApiModelProperty(value = "跟进提醒(数据字典)")
    @Size(max = 64, message = "跟进提醒(数据字典)长度不能超过64")
    @TableField(value = "follow_remind_type", condition = LIKE)
    @Excel(name = "跟进提醒(数据字典)")
    private String followRemindType;

    /**
     * 提醒方式，数据字典,分割
     */
    @ApiModelProperty(value = "提醒方式，数据字典,分割")
    @Size(max = 64, message = "提醒方式，数据字典,分割长度不能超过64")
    @TableField(value = "follow_remind_way", condition = LIKE)
    @Excel(name = "提醒方式，数据字典,分割")
    private String followRemindWay;

    /**
     * 提醒时间
     */
    @ApiModelProperty(value = "提醒时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "follow_remind_time")
    @Excel(name = "提醒时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime followRemindTime;


    @Builder
    public FollowPlan(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Long projectId, Long subsystemId, Long tenantId, Integer isDeleted, 
                    Long subjectId, String subjectType, LocalDateTime planFollowDate, String content, Long followUserId, String followRemindType, 
                    String followRemindWay, LocalDateTime followRemindTime) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.isDeleted = isDeleted;
        this.subjectId = subjectId;
        this.subjectType = subjectType;
        this.planFollowDate = planFollowDate;
        this.content = content;
        this.followUserId = followUserId;
        this.followRemindType = followRemindType;
        this.followRemindWay = followRemindWay;
        this.followRemindTime = followRemindTime;
    }

}
